const Koa = require('koa')
const bodyParser = require('koa-bodyparser')
const cors = require('koa-cors')
const Router = require('./router')
const app = new Koa()

// app.use(cors({
//     // origin: "http://localhost:8080",
//     // origin: "*"
// }))

app.use(bodyParser()) // 必须在路由挂载前挂载否则不生效
Router(app) // 统一挂载路由

app.listen(8888, () => {
    console.log('listen to 8888')
})